﻿using System;
using System.Collections.Generic;
using System.Text;

namespace System
{
    public static class RandomHelper
    {
        public static string GetRandom(string seed, int count)
        {
            Random ran = new Random();
            StringBuilder sb = new StringBuilder(count);
            for (int i = 0; i < count; i++)
            {
                var r = ran.Next(0, seed.Length);
                var c = seed[r];
                sb.Append(c);
            }
            return sb.ToString();
        }

        public static string GetNumber(int count)
        {
            return GetRandom("0123456789", count);
        }
        public static string GetNoZeroNumber(int count)
        {
            return GetRandom("123456789", count);
        } 
        public static byte[] GetBytes(int count)
        {
            Random ran = new Random();
            byte[] bs = new byte[count];
            for (int i = 0; i < count; i++)
            {
                bs[i] = (byte)ran.Next(0, 255);
            }
            return bs;
        }
    }
}
